home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / QD3DStorage.p < prev    next >
Encoding:
Text File  |  1997-08-12  |  5.6 KB  |  143 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        QD3DStorage.p
  3.  
  4.      Contains:    Abstraction to deal with various types of stream-based storage devices        
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.5.1
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1995-1997 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT QD3DStorage;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __QD3DSTORAGE__}
  28. {$SETC __QD3DSTORAGE__ := 1}
  29.  
  30. {$I+}
  31. {$SETC QD3DStorageIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __QD3D__}
  35. {$I QD3D.p}
  36. {$ENDC}
  37.  
  38. {$IFC TARGET_OS_MAC }
  39. {$IFC UNDEFINED __TYPES__}
  40. {$I Types.p}
  41. {$ENDC}
  42. {$IFC UNDEFINED __FILES__}
  43. {$I Files.p}
  44. {$ENDC}
  45. {$ENDC}  {TARGET_OS_MAC}
  46.  
  47.  
  48. {$PUSH}
  49. {$ALIGN POWER}
  50. {$LibExport+}
  51.  
  52. {*****************************************************************************
  53.  **                                                                             **
  54.  **                                Storage Routines                             **
  55.  **                                                                             **
  56.  ****************************************************************************}
  57. FUNCTION Q3Storage_GetType(storage: TQ3StorageObject): LONGINT; C;
  58. FUNCTION Q3Storage_GetSize(storage: TQ3StorageObject; VAR size: LONGINT): TQ3Status; C;
  59.  *    Reads "dataSize" bytes starting at offset in storage, copying into data. 
  60.  *    sizeRead returns the number of bytes filled in. 
  61.  *    
  62.  *    You may assume if *sizeRead < dataSize, then EOF is at offset + *sizeRead
  63.  }
  64. FUNCTION Q3Storage_GetData(storage: TQ3StorageObject; offset: LONGINT; dataSize: LONGINT; VAR data: UInt8; VAR sizeRead: LONGINT): TQ3Status; C;
  65.  *    Write "dataSize" bytes starting at offset in storage, copying from data. 
  66.  *    sizeWritten returns the number of bytes filled in. 
  67.  *    
  68.  *    You may assume if *sizeRead < dataSize, then EOF is at offset + *sizeWritten
  69.  }
  70. FUNCTION Q3Storage_SetData(storage: TQ3StorageObject; offset: LONGINT; dataSize: LONGINT; {CONST}VAR data: UInt8; VAR sizeWritten: LONGINT): TQ3Status; C;
  71. {*****************************************************************************
  72.  **                                                                             **
  73.  **                             Memory Storage Prototypes                         **
  74.  **                                                                             **
  75.  ****************************************************************************}
  76. FUNCTION Q3MemoryStorage_GetType(storage: TQ3StorageObject): LONGINT; C;
  77. {
  78.  * These calls COPY the buffer into QD3D space
  79.  }
  80. FUNCTION Q3MemoryStorage_New({CONST}VAR buffer: UInt8; validSize: LONGINT): TQ3StorageObject; C;
  81. FUNCTION Q3MemoryStorage_Set(storage: TQ3StorageObject; {CONST}VAR buffer: UInt8; validSize: LONGINT): TQ3Status; C;
  82. {
  83.  * These calls use the pointer given - you must dispose it when you're through
  84.  }
  85. FUNCTION Q3MemoryStorage_NewBuffer(buffer: Ptr; validSize: LONGINT; bufferSize: LONGINT): TQ3StorageObject; C;
  86. FUNCTION Q3MemoryStorage_SetBuffer(storage: TQ3StorageObject; buffer: Ptr; validSize: LONGINT; bufferSize: LONGINT): TQ3Status; C;
  87. FUNCTION Q3MemoryStorage_GetBuffer(storage: TQ3StorageObject; VAR buffer: Ptr; VAR validSize: LONGINT; VAR bufferSize: LONGINT): TQ3Status; C;
  88. {$IFC TARGET_OS_MAC }
  89. {*****************************************************************************
  90.  **                                                                             **
  91.  **                                Macintosh Handles Prototypes                 **
  92.  **                                                                             **
  93.  ****************************************************************************}
  94. { Handle Storage is a subclass of Memory Storage }
  95. FUNCTION Q3HandleStorage_New(handle: Handle; validSize: LONGINT): TQ3StorageObject; C;
  96. FUNCTION Q3HandleStorage_Set(storage: TQ3StorageObject; handle: Handle; validSize: LONGINT): TQ3Status; C;
  97. FUNCTION Q3HandleStorage_Get(storage: TQ3StorageObject; VAR handle: Handle; VAR validSize: LONGINT): TQ3Status; C;
  98. {*****************************************************************************
  99.  **                                                                             **
  100.  **                                Macintosh Storage Prototypes                 **
  101.  **                                                                             **
  102.  ****************************************************************************}
  103. FUNCTION Q3MacintoshStorage_New(fsRefNum: INTEGER): TQ3StorageObject; C;
  104. { Note: This storage is assumed open }
  105. FUNCTION Q3MacintoshStorage_Set(storage: TQ3StorageObject; fsRefNum: INTEGER): TQ3Status; C;
  106. FUNCTION Q3MacintoshStorage_Get(storage: TQ3StorageObject; VAR fsRefNum: INTEGER): TQ3Status; C;
  107. FUNCTION Q3MacintoshStorage_GetType(storage: TQ3StorageObject): LONGINT; C;
  108.  
  109. {*****************************************************************************
  110.  **                                                                             **
  111.  **                            Macintosh FSSpec Storage Prototypes                 **
  112.  **                                                                             **
  113.  ****************************************************************************}
  114. FUNCTION Q3FSSpecStorage_New({CONST}VAR fs: FSSpec): TQ3StorageObject; C;
  115. FUNCTION Q3FSSpecStorage_Set(storage: TQ3StorageObject; {CONST}VAR fs: FSSpec): TQ3Status; C;
  116. FUNCTION Q3FSSpecStorage_Get(storage: TQ3StorageObject; VAR fs: FSSpec): TQ3Status; C;
  117. {$ENDC}  {TARGET_OS_MAC}
  118.  
  119. {$IFC TARGET_OS_WIN32 }
  120. {*****************************************************************************
  121.  **                                                                             **
  122.  **                            Win32 HANDLE Storage Prototypes                     **
  123.  **                                                                             **
  124.  ****************************************************************************}
  125. FUNCTION Q3Win32Storage_New(hFile: HANDLE): TQ3StorageObject; C;
  126. FUNCTION Q3Win32Storage_Set(storage: TQ3StorageObject; hFile: HANDLE): TQ3Status; C;
  127. FUNCTION Q3Win32Storage_Get(storage: TQ3StorageObject; VAR hFile: HANDLE): TQ3Status; C;
  128. {$ENDC}  {TARGET_OS_WIN32}
  129.  
  130.  
  131. {$ALIGN RESET}
  132. {$POP}
  133.  
  134. {$SETC UsingIncludes := QD3DStorageIncludes}
  135.  
  136. {$ENDC} {__QD3DSTORAGE__}
  137.  
  138. {$IFC NOT UsingIncludes}
  139.  END.
  140. {$ENDC}
  141.